import axios from "@/utils/request";

// 获取购物车
export const reqCartList = ()=>{
  return axios({
    url: `/cart/cartList`,
    method: 'get'
  })
}

// 删除购物车商品
export const removeCartList = (skuId)=>{
  return axios({
    url: `/cart/deleteCart/${skuId}`,
    method: 'delete'
  })
}

// 切换商品选中状态
export const changeCartCheck = (skuID,isChecked)=>{
  return axios({
    url: `/cart/checkCart/${skuID}/${isChecked}`,
    method: 'get'
  })
}

// 获取用户信息地址
export const getUserAddress = ()=>{
  return axios({
    url: `/user/userAddress/auth/findUserAddressList`,
    method: 'get'
  })
}

// 获取商品清单
export const getUserOrder = ()=>{
  return axios({
    url: `/order/auth/trade`,
    method: 'get'
  })
}

// 提交订单
export const addUserOrder = (tradeNo, data)=>{
  return axios({
    url: `/order/auth/submitOrder?tradeNo=${tradeNo}`,
    method: 'post',
    data
  })
}
